<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>用户登录</title>
</head>
<body>
<%
    if (request.getSession().getAttribute("login_error") != null) { // 登录错误
        out.print("<script>alert(\"" + (request.getSession().getAttribute("login_error")) + "\");</script>");
        request.getSession().removeAttribute("login_error");
        out.print("<script>location.reload();</script>");
    } else {
%>
<%
    if (request.getSession().getAttribute("user_reg_message") != null) { // 登录错误
        out.print("<script>alert(\"" + (request.getSession().getAttribute("user_reg_message")) + "\");</script>"); // 弹窗提示
        request.getSession().removeAttribute("user_reg_message"); // 删除会话网页
    }
%>
<form method="post" id="form1" name="form1" action="${pageContext.request.contextPath}/deal/login.jsp">
    <table>
        <tr>
            <td colspan="2">
                <label>登录</label>
            </td>
        </tr>
    </table>
    <label>
        用户名：
        <input type="text" name="name"/>
    </label><br>
    <label>
        密码：
        <input type="password" name="password"/>
    </label><br>
    <label>
        验证码：
        <input type="text" name="validateCode">
    </label><br>
    <label>
        <img src="<c:url value="/validateCode"/>" alt="validateCode" height="60px">
    </label><br>
    <input type="submit" value="登录">
    <button type="button" onclick="location.href='register.jsp'">注册</button>
</form>
<%
    }
%>
</body>
</html>
